<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <h3></h3>
                   
    <div class="box">
        <h3></h3>
        <p></p>
    </div>

    <p></p>
    <p></p>
    <p></p>

    <script>

        // arguments 
        // getElementsByClassName / ....
        // classList 


        // qsa   getElementsByClassName   
        //      qsa 深复制   页面变了 qsa不会变
        //      getElementsByClassName  浅复制    页面变了也会跟着变


        // 伪数组转真数组
        //    1 遍历  push到新数组中
        //    2  ... 


        var oP1 = document.getElementsByTagName('p');
        console.log(oP1);   // HTMLCollection

        var oPs = document.querySelectorAll('p') ;
        console.log(oPs);   // NodeList
        var arr = [...oPs] ;
        console.log(arr);



        var oBox = document.querySelector('.box') ;
        console.log(oBox.children);
        console.log(oBox.childNodes);

        console.log(oBox.previousSibling);
        console.log(oBox.previousElementSibling);
    </script>
    
</body>
</html>